package me.yushuai.wukong.base.api;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import me.yushuai.wukong.base.api.dto.PagingSearchAttachment;
import me.yushuai.wukong.base.api.vo.AttachmentVo;
import me.yushuai.wukong.common.dto.PageDTO;
import me.yushuai.wukong.common.exceptin.DuplicateBizIdException;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.multipart.MultipartFile;

/**
 * 附件管理Api
 *
 * @author zhoushuai@189.cn
 * @since 2023-09-20
 */
@Api("附件管理API" )
@FeignClient("${spring.application.name}")
public interface AttachmentApi {

    /**
     * 上传附件
     *
     * @param multipartFile 上传附件
     * @return 返回附件信息
     * @throws DuplicateBizIdException 当装箱编码已经存在时抛出异常
     */
    @ApiOperation("新建附件")
    @PostMapping("/attachment")
    Long createAttachment(MultipartFile multipartFile) throws DuplicateBizIdException;


    PageDTO<AttachmentVo> page(PagingSearchAttachment request);
}
